﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace QuanLiGiaiBongDa
{
    class User
    {

        public bool CheckLogin(string name, string pass)
        {
            SqlConnection con = ConnectToDataBase.StartConnection();
            SqlCommand cmd = new SqlCommand("select * from TaiKhoan where userName ='" + name + "' and Pass = '" + pass + "'", con);
            con.Open();
            SqlDataReader dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                con.Close();
                return true;
            }
            con.Close();
            return false;
        }
    }
}
